﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Ext.Net;
using Ext.Net.MVC;
using WebEntities;
using WebEntities.Models.WebInfo;
using com.subb.WebInfo;

namespace WebAdmin.Controllers
{
    [Authorize]
    public class ReplyMsgController : Controller
    {
        [HttpPost]
        public ActionResult SaveReplyMsg(ReplyMsg reply)
        {
            FormPanelResult response = new FormPanelResult();
            try
            {
                string creator = Request.IsAuthenticated ? HttpContext.User.Identity.Name : "Anonymous";
                reply.Creator = creator;
                reply.ReplyContent = Server.HtmlEncode(reply.ReplyContent);
                reply.ReplyMan = Server.HtmlEncode(reply.ReplyMan);
                WI_LeaveMsgReplyDAL mrdal = new WI_LeaveMsgReplyDAL();
                mrdal.SaveReplyMsg(reply.MsgID, reply);
                response.Success = true;
                response.ExtraParams.Add(new Parameter("Msg", "保存成功！"));
                return response;
            }
            catch (Exception ex)
            {
                response.Success = false;
                response.ExtraParams.Add(new Parameter("Msg", ex.InnerException != null ? ex.InnerException.Message : ex.Message));
                return response;
            }
        }

    }
}
